<%--
    file: login.jsp
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%
    String message = "";
    if (null != request.getAttribute("msg")) {
        message = request.getAttribute("msg").toString();
    }
    String logined = "";
    if (null != request.getAttribute("logined")) {
        logined = request.getAttribute("logined").toString();
    }


%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="/StudentClientWeb/img/style.css" />
        <title>Module Search System</title>
    </head>

    <body>
        <div id="page">

            <div id="header">
                <h1>Module Search System</h1>
                <h2>Web-based client application, Module Search System for Student</h2>

            </div>
            <div id="bar">
                    <% if ("true" == logined) {%>
                <div class="link"><a href="module">Module Search</a></div>
                <div class="link"><a href="mymodules">My Modules</a></div>
                <div class="link"><a href="profile">Profile</a></div>
                <div class="link"><a href="logout">Logout</a></div>
                    <% } else {%>
                <div class="link"><p>Module Search</p></div>
                <div class="link"><p>My Module</p></div>
                <div class="link"><p>Profile</p></div>
                <div class="link"><p>Login</p></div>
                    <% }%>
            </div>
            <div class="contentTitle"><h1>Student Login</h1></div>
            <div class="contentText">

                <div class="notify notify-yellow"><span class="symbol icon-excl"></span> Matric Number is case sensitive !</div>
                <% if ("true" == logined) {%>
                <div class="notify notify-green"><span class="symbol icon-tick"></span> <%= message%></div>
                <% } else {%>
                <% if ("false" == logined) {%>
                <div class="notify notify-red"><span class="symbol icon-error"></span> <%= message%> </div>
                <% }%>
                <form action="login" method="post">
                    <table width="500" border="0" cellspacing="0" cellpadding="5">
                        <tr>
                            <td width="120" style="text-align:right">Matric Number</td>
                            <td><input type="text" name="matricnumber"/></td>
                        </tr>
                        <tr>
                            <td style="text-align:right">Password</td>
                            <td><input type="password" name="password"/></td>
                        </tr>
                        <tr>
                            <td><input type="hidden" name="reqfunction" value="login"/></td>
                            <td><input type="submit" value="Login"></td>
                        </tr>

                        <tr>
                            <td><%= logined%> </td>
                            <td><%= message%> </td>
                        </tr>
                    </table>			

                </form>
                <% }%> 

            </div>
        </div>
        <div id="footer"><a href="http://www.culin.net">web development</a> by <a href="http://www.cuilin.com">Cui Lin</a></div>
    </body>
</html>